package com.goods.controller.business;

import com.goods.business.service.InStockService;
import com.goods.business.service.OutStockService;
import com.goods.common.response.ResponseBean;
import com.goods.common.vo.business.InStockDetailVO;
import com.goods.common.vo.business.InStockVO;
import com.goods.common.vo.business.OutStockVO;
import com.goods.common.vo.system.PageVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: 赵勇镔
 * @Time: 2021/6/10 15:32
 * @Description:
 */

@Api(tags = "业务模块-入库记录")
@RestController
@RequestMapping("/business/outStock")
public class OutStockController {

    @Autowired
    private OutStockService outStockService;

    @ApiOperation(value = "出库记录", notes = "物资出库列表")
    @GetMapping("/findOutStockList")
    public ResponseBean<PageVO<OutStockVO>> findOutStockList(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                             @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
                                                             OutStockVO outStockVO) {

        PageVO<OutStockVO> pageVO = outStockService.findOutStockList(pageNum,pageSize,outStockVO);
        return ResponseBean.success(pageVO);
    }

/*

    @ApiOperation(value = "入库记录", notes = "物资明细列表")
    @GetMapping("/detail/{id}")
    public ResponseBean<InStockDetailVO>  detail(@RequestParam  Integer pageNum, @PathVariable Integer id) {

        InStockDetailVO inStockDetailVO = outStockService.detail(pageNum,id);
        return ResponseBean.success(inStockDetailVO);
    }

    @ApiOperation(value = "入库记录", notes = "物资明细列表添加回收站")
    @PutMapping("/remove/{id}")
    public ResponseBean  remove(@PathVariable Long id) {

        outStockService.remove(id);
        return ResponseBean.success();
    }

    @ApiOperation(value = "入库记录", notes = "物资明细列表回收站还原")
    @PutMapping("/back/{id}")
    public ResponseBean  back(@PathVariable Long id) {

        outStockService.back(id);
        return ResponseBean.success();
    }

    @ApiOperation(value = "入库记录", notes = "物资明细列表删除")
    @GetMapping("/delete/{id}")
    public ResponseBean  delete(@PathVariable Long id) {

        outStockService.delete(id);
        return ResponseBean.success();
    }

    @ApiOperation(value = "入库记录", notes = "入库信息保存")
    @PostMapping("/addIntoStock")
    public ResponseBean  addIntoStock(@RequestBody InStockVO inStockVO) {
        outStockService.addIntoStock(inStockVO);
        return ResponseBean.success();
    }

    @ApiOperation(value = "入库记录", notes = "入库信息审核通过")
    @PutMapping("/publish/{id}")
    public ResponseBean  publish(@PathVariable Long id) {
        outStockService.publish(id);
        return ResponseBean.success();
    }
*/

}
